package main

import "fmt"

type Second int
type Person struct {
	Name string
	Age  int
}

func (s *Second) double() {
	(*s) *= 2
}

func (s Second) show() {
	fmt.Printf("I'm %d\n", s)
}

func (p *Person) grow() *Person {
	p.Age += 1
	return p
}

func (p Person) show() {
	fmt.Printf("I'm %s, %d years old\n", p.Name, p.Age)
}

func main() {
	s := Second(2)
	s.show()
	s.double()
	s.show()
	Second(5).show()

	p := Person{"allen", 19}
	p.grow()
	p.show()

	// pp := &Person{"luffy", 18}
	pp := new(Person)
	pp.grow()
	pp.show()
	(&Person{"zoro", 19}).grow().show()
}
